﻿@model DataAccess.DB.XuatKho
@using DuocThaiBinh.Common;

@{
    ViewBag.Title = "Details";
    Layout = "~/Views/Shared/_Layout_Printf.cshtml";    
}

<table class="ms-form-table-hd">
    <tr>
        <th colspan="8">
            <span style="font-size:16px">Chi tiết hóa đơn</span>
        </th>
    </tr>
    <tr>
        <td style="width:50px">STT</td>
        <td style="width:400px">Mã sản phẩm</td>
        <td style="width:50px">ĐVT</td>
        <td style="width:100px">S.lượng</td>
        <td style="width:150px">Giá</td>
        <td style="width:200px">Thành tiền</td>
        <td style="">HSD</td>
    </tr>
    @{string[] listmasanpham = @ViewBag.listSP;
      string[] listSoluong = @ViewBag.listsoLuong;
      string[] listgia = @ViewBag.listgia;
      string[] listDonvi = @ViewBag.listDonvi;
      string[] listHSD = @ViewBag.listHSD;
    }
    @{for (int i = 0; i < listmasanpham.Length; i++)
      {
          var gia = DuocThaiBinh.Common.Util.ConvertCurrencyToMoney(listgia[i]);
          var thanhtien = DuocThaiBinh.Common.Util.ConvertDecimaToCurrency(gia * Util.ConvertObjectToIn(listSoluong[i]));
        <tr>
            <td style="text-align: center">
                @{int k = i + 1;
                    <span>@k</span>}
            </td>
            <td style="text-align: left">
                @listmasanpham[i]
            </td>
            <td style="text-align: center">
                @listDonvi[i]
            </td>
            <td style="text-align: center">
                @listSoluong[i]
            </td>
            <td style="text-align: center">
                @listgia[i]
            </td>
            <td style="text-align: center">
                @thanhtien
            </td>
            <td style="text-align: center">
                @listHSD[i]
            </td>
        </tr>
      }}

</table>
